package com.igd.framework.mybatis.spring.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;

import com.igd.framework.mybatis.spring.dto.Student;

public class StudentMapperImpl implements StudentMapper {
	
	private SqlSessionTemplate sqlSession;
	
	public StudentMapperImpl(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

	@Override
	public List<Student> queryStudent() {
		StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
        return mapper.queryStudent();
	}

	@Override
	public Student queryStudentId(int i) {
		StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
		return mapper.queryStudentId(i);
	}

	@Override
	public List<Student> queryStudentDong(Map<?, ?> map) {
		StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
		return mapper.queryStudentDong(map);
	}

	@Override
	public int addStudent(Student student) {
		StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
		return mapper.addStudent(student);
	}

	@Override
	public int updateStudent(Student student) {
		StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
		return mapper.updateStudent(student);
	}

	@Override
	public int deleteStudentId(int id) {
		StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
		return mapper.deleteStudentId(id);
	}

}
